<template>
  <div class="all">
    <div class="box">
      <span class="s1">新品推荐</span>
      <span class="s2">查看更多</span>
    </div>
    <ul>
      <li v-for="all in alls" :key="all.id">
        <img :src="all.img" />
        <p>{{ all.name }}</p>
        <span>{{ all.price }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "all",
  props: {
    type: String,
  },
  data() {
    return {
      alls: [],
    };
  },
  created() {
    axios({
      url: "/all",
      method: "get",
    }).then((res) => {
      this.alls = res.data;
      console.log(res.data);
    });
  },
  methods: {},
  components: {},
};
</script>
<style>
html,
body {
  height: 100%;
}
html {
  font-size: 26.67vw;
}
body {
  font-size: 16px;
  display: flex;
  flex-direction: column;
}
.all {
  width: 100%;
  height: auto;
  overflow-x: hidden;
}
.all > .box {
  height: 0.55rem;
  font-size: 0.18rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.all .s1{
    font-weight: 700;
}
.all .s2{
    font-size: .14rem;
    color: orange;
}
.all > .box>span{
    width: 30%;
    text-align: center;
}
.all ul{
    list-style: none;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
}
.all ul>li{
    width: 48%;
    height: 2.45rem;
    display: flex;
    flex-direction: column;
    border: .01rem solid #e5e5e5;
    margin-top: .1rem;
}
.all ul>li>p{
    margin: .05rem .1rem;
    font-size: .16rem;
    white-space: nowrap;
    overflow-x: hidden;
    Text-overflow: ellipsis
}
.all ul>li>span{
    margin: 0 .1rem;
    font-size: .16rem;
    color: rgb(255, 183, 49);
    font-weight: 700;
}
</style>
